Optimal. Leaf size=94 \[ \frac {\log (1-\cos (c+d x))}{2 (a+b) d}-\frac {\log (\cos (c+d x))}{b d}-\frac {\log (1+\cos (c+d x))}{2 (a-b) d}+\frac {a^2 \log (b+a \cos (c+d x))}{b \left (a^2-b^2\right ) d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 94, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4482, 2916, 12,
908} \begin {gather*} \frac {a^2 \log (a \cos (c+d x)+b)}{b d \left (a^2-b^2\right )}+\frac {\log (1-\cos (c+d x))}{2 d (a+b)}-\frac {\log (\cos (c+d x)+1)}{2 d (a-b)}-\frac {\log (\cos (c+d x))}{b d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 908
Rule 2916
Rule 4482
Rubi steps
\begin {align*} \int \frac {\sec ^2(c+d x)}{a \sin (c+d x)+b \tan (c+d x)} \, dx &=\int \frac {\csc (c+d x) \sec (c+d x)}{b+a \cos (c+d x)} \, dx\\ &=-\frac {a \text {Subst}\left (\int \frac {a}{x (b+x) \left (a^2-x^2\right )} \, dx,x,a \cos (c+d x)\right )}{d}\\ &=-\frac {a^2 \text {Subst}\left (\int \frac {1}{x (b+x) \left (a^2-x^2\right )} \, dx,x,a \cos (c+d x)\right )}{d}\\ &=-\frac {a^2 \text {Subst}\left (\int \left (\frac {1}{2 a^2 (a+b) (a-x)}+\frac {1}{a^2 b x}+\frac {1}{2 a^2 (a-b) (a+x)}+\frac {1}{b (-a+b) (a+b) (b+x)}\right ) \, dx,x,a \cos (c+d x)\right )}{d}\\ &=\frac {\log (1-\cos (c+d x))}{2 (a+b) d}-\frac {\log (\cos (c+d x))}{b d}-\frac {\log (1+\cos (c+d x))}{2 (a-b) d}+\frac {a^2 \log (b+a \cos (c+d x))}{b \left (a^2-b^2\right ) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.18, size = 103, normalized size = 1.10 \begin {gather*} 2 \left (\frac {\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 (-a+b) d}-\frac {\log (\cos (c+d x))}{2 b d}-\frac {a^2 \log (b+a \cos (c+d x))}{2 b \left (-a^2+b^2\right ) d}+\frac {\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 (a+b) d}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.34, size = 87, normalized size = 0.93
method | result | size |
derivativedivides | \(\frac {\frac {a^{2} \ln \left (b +a \cos \left (d x +c \right )\right )}{\left (a +b \right ) \left (a -b \right ) b}-\frac {\ln \left (\cos \left (d x +c \right )\right )}{b}+\frac {\ln \left (\cos \left (d x +c \right )-1\right )}{2 a +2 b}-\frac {\ln \left (1+\cos \left (d x +c \right )\right )}{2 a -2 b}}{d}\) | \(87\) |
default | \(\frac {\frac {a^{2} \ln \left (b +a \cos \left (d x +c \right )\right )}{\left (a +b \right ) \left (a -b \right ) b}-\frac {\ln \left (\cos \left (d x +c \right )\right )}{b}+\frac {\ln \left (\cos \left (d x +c \right )-1\right )}{2 a +2 b}-\frac {\ln \left (1+\cos \left (d x +c \right )\right )}{2 a -2 b}}{d}\) | \(87\) |
risch | \(-\frac {i x}{a +b}-\frac {i c}{d \left (a +b \right )}+\frac {i x}{a -b}+\frac {i c}{d \left (a -b \right )}-\frac {2 i a^{2} x}{b \left (a^{2}-b^{2}\right )}-\frac {2 i a^{2} c}{b d \left (a^{2}-b^{2}\right )}+\frac {2 i x}{b}+\frac {2 i c}{b d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d \left (a +b \right )}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d \left (a -b \right )}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 b \,{\mathrm e}^{i \left (d x +c \right )}}{a}+1\right )}{b d \left (a^{2}-b^{2}\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{b d}\) | \(223\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 125, normalized size = 1.33 \begin {gather*} \frac {\frac {a^{2} \log \left (a + b - \frac {{\left (a - b\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}{a^{2} b - b^{3}} - \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{b} - \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{b} + \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a + b}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.11, size = 96, normalized size = 1.02 \begin {gather*} \frac {2 \, a^{2} \log \left (a \cos \left (d x + c\right ) + b\right ) - 2 \, {\left (a^{2} - b^{2}\right )} \log \left (-\cos \left (d x + c\right )\right ) - {\left (a b + b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left (a b - b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{2} b - b^{3}\right )} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec ^{2}{\left (c + d x \right )}}{a \sin {\left (c + d x \right )} + b \tan {\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 253 vs.
\(2 (90) = 180\).
time = 0.56, size = 253, normalized size = 2.69 \begin {gather*} \frac {\frac {b \log \left ({\left | a + b + \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {b {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} \right |}\right )}{a^{2} - b^{2}} + \frac {{\left (2 \, a^{2} - b^{2}\right )} \log \left (\frac {{\left | -2 \, a - \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - 2 \, {\left | b \right |} \right |}}{{\left | -2 \, a - \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + 2 \, {\left | b \right |} \right |}}\right )}{{\left (a^{2} - b^{2}\right )} {\left | b \right |}} + \frac {\log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right )}{a + b}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.84, size = 93, normalized size = 0.99 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d\,\left (a+b\right )}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}{b\,d}+\frac {a^2\,\ln \left (a+b-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d\,\left (a^2\,b-b^3\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________